package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysItemCategoryMapper;
import com.ruoyi.system.domain.SysItemCategory;
import com.ruoyi.system.service.ISysItemCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author silencezheng
 * @date 2022-10-29
 */
@Service
public class SysItemCategoryServiceImpl implements ISysItemCategoryService 
{
    @Autowired
    private SysItemCategoryMapper sysItemCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public SysItemCategory selectSysItemCategoryById(Integer id)
    {
        return sysItemCategoryMapper.selectSysItemCategoryById(id);
    }

    /**
     * 查询商品分类列表
     * 
     * @param sysItemCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<SysItemCategory> selectSysItemCategoryList(SysItemCategory sysItemCategory)
    {
        return sysItemCategoryMapper.selectSysItemCategoryList(sysItemCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param sysItemCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertSysItemCategory(SysItemCategory sysItemCategory)
    {
        sysItemCategory.setCreateTime(DateUtils.getNowDate());
        return sysItemCategoryMapper.insertSysItemCategory(sysItemCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param sysItemCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateSysItemCategory(SysItemCategory sysItemCategory)
    {
        sysItemCategory.setUpdateTime(DateUtils.getNowDate());
        return sysItemCategoryMapper.updateSysItemCategory(sysItemCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSysItemCategoryByIds(Integer[] ids)
    {
        return sysItemCategoryMapper.deleteSysItemCategoryByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSysItemCategoryById(Integer id)
    {
        return sysItemCategoryMapper.deleteSysItemCategoryById(id);
    }
}
